(function(clazz,pid,callback,updata){
	var classdat = Get("/clazz/name/"+clazz).obj;
	var fields   = classdat.fields;
	
	var itemsfields   = _("task.add.fun.getItemsByDisplayfield")(fields); 
	var items	= [];
	
	
	//log(updata);
	if(updata.taskVariables!=null){
		var kvalues = [];
		var i=0;
		for(up in updata.taskVariables){
			
			kvalues.push({
				"keyx":up,
				"valuex":updata.taskVariables[up]
			});
			i++;
		} 
		//log(kvalues);
		if(i!=0)
		items.push({
			title:"基本信息",
	        xtype: "grid",
	        columns:[{
	        	header	 :'事件', 
	        	dataIndex:"keyx"
	        },{
	        	header	 :'详情', 
	        	dataIndex:"valuex", flex: 1 
	        }],
	        store:{
	        	data:kvalues,
		        proxy: {
		            type: 'memory',
		            reader: {
		                type: 'json',
		                root: '.'
		            }
		        }
	        }
	        
		});
	}

	
	
	
	
	
	if(updata.formKey!=null){
		var bd = Get("/clazz/name/"+updata.formKey).obj;
		items.push({
			title:"表单",
	        layout: {
	            type: 'absolute'
	        },
	        xtype: "form",
	        items:_("task.add.fun.getItems")(bd.fields,updata.formKey,updata)
		});
	}
	//log(updata);	
	
	items.push({
		title:"流程",
        layout: {
            type: 'absolute'
        },
        html:'<img  src="/process/readImage/'+updata.processInstanceId+'?'+getOnly()+'"  alt="上海鲜花港 - 郁金香" />'
	});
	var bbaritem = ["->"/*,*/];
	var tempk = 0;
	for(co in updata.come){
		tempk =1;
		bbaritem.push({
			text:updata.come[co],
			handler:function(){
			//	alert(this.text);
				if(updata.formKey!=null){
				var bd = Get("/clazz/name/"+updata.formKey).obj;
				//var msg = Get("/process/start/xxy/"+updata.id);
				var values = _("task.add.fun.getValue")(bd);
				values.user="xxy";
				values["跳转"]=this.text;
				values.id  =updata.id;
				var msg = Post("/process/completeTask/",values);
				if(msg!=null){
					eval(callback)(this.ownerCt.ownerCt.dat.name,this.ownerCt.ownerCt.pid);
					this.ownerCt.ownerCt.close();
				} 
			}else{
				var values={};
				values["跳转"]=this.text;
				values.user="xxy";
				values.id  =updata.id;
				var msg=Post("/process/completeTask/",values);
				if(msg!=null){
					eval(callback)(this.ownerCt.ownerCt.dat.name,this.ownerCt.ownerCt.pid);
					this.ownerCt.ownerCt.close();
				}
			} 
			}
		});
	}
	if(tempk==0){
		bbaritem.push({
			text:"提交",handler:function(){
				//log(updata.id);
				if(updata.formKey!=null){
					var bd = Get("/clazz/name/"+updata.formKey).obj;
					//var msg = Get("/process/start/xxy/"+updata.id);
					var values = _("task.add.fun.getValue")(bd);
					values.user="xxy";
					values.id  =updata.id;
					var msg = Post("/process/completeTask/",values);
					if(msg!=null){
						eval(callback)(this.ownerCt.ownerCt.dat.name,this.ownerCt.ownerCt.pid);
						this.ownerCt.ownerCt.close();
					} 
				}else{
					var values={};
					values.user="xxy";
					values.id  =updata.id;
					var msg=Post("/process/completeTask/",values);
					if(msg!=null){
						eval(callback)(this.ownerCt.ownerCt.dat.name,this.ownerCt.ownerCt.pid);
						this.ownerCt.ownerCt.close();
					}
				} 
				
			}
		});
	}
	
	
	var	win	= new Ext.window.Window({
		title		:	"查看",
		modal 		:	true,   
		constrain	:	true, 	// 防止窗口超出浏览器窗口,保证不会越过浏览器边界
		resizable	:	false, 	// 是否可以调整窗口大小，默认TRUE。
		plain		:	true,	// 将窗口变为半透明状态。 
		draggable 	:	false,	//不可以移动
		height		:	"60%",
		width		:	650,
		//maximized:true,
		maximizable:true,
		layout		: 	{
			type	:	'fit',
			align	:	'stretch'
	    },
	    dat			:   classdat,
	    pid			:   pid,
	   // html		:	"<iframe style='width:100%;height:100%' src='modeler.html?modelId=7501'></iframe> ",
	    items		:	{
			 xtype	:	'tabpanel', 
			 flex: 1,
			 items	:	items
		}, 
		bbar:bbaritem,/**/
		listeners:{
			/*show:function(){
				if(updata!=null){
					var fields = classdat.fields;
					for(f in fields){
						if(fields[f].type=="obj"){
							Ext.getCmp(fields[f].name+"_id").setValue(updata[fields[f].name]["id"]);
							Ext.getCmp(fields[f].name).setValue(updata[fields[f].name][fields[f].clazzQuery]);
						}else if(fields[f].type!="list"){
							if(fields[f].type=="date"){
								Ext.getCmp(fields[f].name).setValue(new Date(updata[fields[f].name]));
							}else{
								Ext.getCmp(fields[f].name).setValue(updata[fields[f].name]);
							}
							
						}
					}
					//Ext.getCmp("id").setValue(updata["id"])
				}
			}*/
		}
	});
	_("tools.winshow")(win);
})